CLAPACK_ROOT 	     = ../CLAPACK-3.2.1/
LIBLC                = ../../../libLC_unif/
LIBLCKP		     = ../../../Include/
CC                   = gcc44
CXX                  = g++44 
LINK_OPT             = 
VERSION              = 
OPTIMIZE_FLAGS       = -O3 -finline-functions
CXXFLAGS             = -Wall
CFLAGS               =
LDFLAGS              = 
INCS                 = -I$(CLAPACK_ROOT)/INCLUDE/ -I /home/dematteis/glibc-bin2/include/ -I /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/include/ -I /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/include-fixed/ -I /usr/src/kernels/2.6.18-194.32.1.el5-x86_64/include/ -I ../../../libLC_unif/  -I$(LIBLC) -DAFFINITY
LIBS                 = $(CLAPACK_ROOT)/lapack_LINUX.a $(CLAPACK_ROOT)/blas_LINUX.a $(CLAPACK_ROOT)/tmglib_LINUX.a $(CLAPACK_ROOT)/F2CLIBS/libf2c.a $(CLAPACK_ROOT)/BLAS/WRAP/libcblaswr.a $(LIBLC)/libchan.a $(LIBLC)/libsync.a  -L /home/dematteis/glibc-bin2/lib/ -lpthread

#-lcblas

#-lpthread -llapack_atlas -L/usr/lib64/atlas -lcblas

INCLUDES             = -I. $(INCS) -I$(CLAPACK_ROOT)/BLAS/WRAP/
TARGET               = 	parChol		

.PHONY: all clean cleanall distclean install uninstall
.SUFFIXES: .c .cpp .o

%.d: %.cpp
	set -e; $(CXX) -MM $(INCLUDES) $(CXXFLAGS) $< \
		| sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
		[ -s $@ ] || rm -f $@
%.d: %.c
	set -e; $(CC) -MM $(INCLUDES) $(CFLAGS)  $< \
		| sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
		[ -s $@ ] || rm -f $@
%.o: %.cpp
	$(CXX) $(INCLUDES) $(CXXFLAGS) $(OPTIMIZE_FLAGS) -c -o $@ $<
%.o: %.c
	$(CC) $(INCLUDES) $(CFLAGS) -c -o $@ $<
%: %.o
	$(CXX) $< -o $@ $(LIBS)


all: $(TARGET)

parChol:parChol.o

parCholKP:parCholKP.cpp
	$(CXX) -I$(CLAPACK_ROOT)/INCLUDE/ -I /home/dematteis/glibc-bin2/include/ -I /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/include/ -I /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/include-fixed/ -I /usr/src/kernels/2.6.18-194.32.1.el5-x86_64/include/ -I$(LIBLCKP) parCholKP.cpp ../CLAPACK-3.2.1//lapack_LINUX.a ../CLAPACK-3.2.1//blas_LINUX.a ../CLAPACK-3.2.1//tmglib_LINUX.a ../CLAPACK-3.2.1//F2CLIBS/libf2c.a ../CLAPACK-3.2.1//BLAS/WRAP/libcblaswr.a ../../../bin/libchan.a   -L /home/dematteis/glibc-bin2/lib/ -lpthread -o parCholKP -DAFFINITY

clean: 
	-rm -fr *.o *~ 
cleanall: clean
	-rm -fr $(TARGET) *.d parCholKP

include $(OBJS:.o=.d)
